{extend name='public/layout' /}
{block name='content'}
{include file='loupan/nav' /}
<div class="h_s_n3_t"><h1 class="h1_title"><span class="h1_title_t">楼盘动态</span></h1></div>
<div class="h_s_n3">
    {fang:lists table='article' field='id,title,create_time,cate_id,description' where="house_id=$id and status=1" order='ordid asc,id desc' limit='2' id='data'}
    <dl>
            <dt><a title="{$data.title}" href="{:url('News/detail',['id'=>$data['id']])}">{$data.title}</a></dt>
            <dd><em>分类∶{$articleCate['cate'][$data['cate_id']]['name']}</em><em>时间∶{$data.create_time|date='Y-m-d',###}</em></dd>
            <dd><span><a href="{:url('News/detail',['id'=>$data['id']])}">{:msubstr($data['description'],0,68)}</a></span></dd>
        </dl>
    {/fang:lists}
    <p><a href="{:url('Loupan/news',['house_id'=>$info['id']])}" class="but02">查看该楼盘全部动态</a></p>
</div>
{notempty name='info.special_youhui'}
<div class="div_box">
    <h1 class="h1_title"><span class="h1_title_t">独家优惠</span></h1>
    <div class="pageData" style="color: orange">
        {$info.special_youhui}
    </div>
</div>
{/notempty}
{notempty name='info.youdian'}
<div class="div_box">
    <h1 class="h1_title"><span class="h1_title_t">楼盘优势</span></h1>
    <div class="pageData" style="color: orange">
        {$info.youdian}
    </div>
</div>
{/notempty}
{notempty name='info.quedian'}
<div class="div_box">
    <h1 class="h1_title"><span class="h1_title_t">楼盘不足</span></h1>
    <div class="pageData" style="color: orange">
        {$info.quedian}
    </div>
</div>
{/notempty}
<div class="div_box03">
    <div class="h_s_n3_t"><h1 class="h1_title"><span class="h1_title_t">报名看房</span></h1></div>
    <div class="pageSignUp">
        <dl>
            <dt>看房热线（24小时服务）<em>全程免费接机安排</em></dt>
            <dd><b>{$site.telphone}</b></dd>
        </dl>
        <form action="{:url('Ajax/addOrder')}" method="post" id="form">
        <ul>
            <li class="pageSignUp_ico16"><input type="text" placeholder="您的称呼" required="" class="itext" id="name" name="name"></li>
            <li class="pageSignUp_ico17"><input type="text" placeholder="您的手机号码" required="" class="itext" id="phone" name="phone"></li>
            <p><a href="javascript:;" class="but03" id="baoming_btn">提交报名</a></p>
            <input type="hidden" value="house" name="model">
            <input type="hidden" value="1" name="type" id="type">
            <input type="hidden" value="{$info.id}" name="house_id" id="house_id">
        </ul>
        </form>
    </div>
</div>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/plugins/jquery.ajax.form.js"></script>
<script>
    $(function(){
        $('#baoming_btn').on('click',function(){
            var name = $.trim($('#name').val()),phone = $('#phone').val(),reg = /^1[34578][0-9]{9}$/;
            if(name.length == 0){
                layer.msg('请填写您的姓名',{icon:2});
                return false;
            }
            if(!reg.test(phone)){
                layer.msg('请填写正确的手机号码',{icon:2});
                return false;
            }
            layer.load(1);
            $('#form').submit();
        });
    });

    $('#form').ajaxForm({success:complate,dataType:'json'});
    function complate(result){
        layer.closeAll();
        if(result.status == 1){
            layer.msg(result.msg,{icon:1});
            $('#name').val(' ');
            $('#phone').val(' ');
        } else {
            layer.msg(result.msg,{icon:2});
        }
    }
</script>
{/block}